<?php
    $months = array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep",
    "Oct", "Nov", "Dec");
    ini_set("date.timezone", "Europe/Paris");

    $this_day = now();
    $pattern = "%Y";
    $str_year = mdate($pattern, $this_day);

    for ($i = 0; $i < 12; $i++) {
        $dropdown_data[$i + 1] = $months[$i];
    }
    for ($i = 0; $i < 31; $i++) {
        $day_data[$i + 1] = $i + 1;
    }
    for ($i = $str_year; $i > 1900; $i--) {
        $year_data[$i] = $i;
    }

$selected_region_setting = array(
        'table_name' => 'animus_sub_region',
        'key_field' => 'id',
        'value_field' => 'name',
    );

?>
<div id="wrapper-content" align="left">
    <?php echo form_open_multipart('user/register_gardient')?>
        <div class="titre_home" >INSCRIPTION POUR GARDIEN</div>
         <?php if(validation_errors()!="") {?><div class="error_form"><?php echo validation_errors(); ?></div><?php } ?>
        <table class="list" width="90%" cellpadding="5px">
            <tr>
                <td ><label for="gardient_name">Identifiant <font color="red">*</font></label></td>
                <td><input type="text" size="35" name="gardient_name" value="<?php echo set_value('gardient_name'); ?>" id="gardient_name"/></td>
            </tr>
           
            <tr>
                <td >
                    <label for="password">Mot de passe <font color="red">*</font></label>
                </td>
                <td><input type="password" size="35" name="password"/></td>
            </tr>
            
            <tr>
                <td >
                    <label for="confirm_pass">Confirmation du mot de passe <font color="red">*</font></label>
                </td>
                <td><input type="password" size="35" name="confirm_pass"/></td>
            </tr>
          
            <tr>
                <td>
                    <label for="first_name">Nom<font color="red">*</font></label>
                </td>
                <td><input type="text" size="35" name="first_name" id="first_name" value="<?php echo set_value('first_name'); ?>"/></td>
            </tr>
   
            <tr>
                <td >
                    <label for="last_name">Prénom <font color="red">*</font></label>
                </td>
                <td><input type="text" size="35" name="last_name" id="last_name" value="<?php echo set_value('last_name'); ?>"/></td>
            </tr>
           
            <tr>
                <td>
                    <label for="email">Email <font color="red">*</font></label>
                </td>
                <td><input type="text" size="35" name="email" value="<?php echo set_value('email'); ?>"/></td>
            </tr>
            
            <tr>
                <td><label >Image:</label></td>
                <td><input type="file" name="userfile" id="userfile" size="23"/></td>
            </tr>
            <tr>
                <td >
                    <label for="experience">Expérience <font color="red">*</font></label>
                </td>
                <td><input type="text" size="35" name="experience" id="company" value="<?php echo set_value('experience'); ?>"/></td>
            </tr>
           
            <tr>
                <td><label for="dob">Date de naissance</label></td>
                <td>
                    J : <?php echo form_dropdown('birth_date', $day_data, 1, 'id="day"'); ?>
                    M : <?php echo form_dropdown('birth_month', $dropdown_data, 1, 'id="month"'); ?>
                    A : <?php echo form_dropdown('birth_year', $year_data, $str_year, 'id="year"'); ?>
                </td>
            </tr>
            <tr>
                <td><label for="gender">Sexe</label></td>
                <td>
                    <?php
                        $male = array(
                        'name' => 'gender',
                        'id' => 'rad_male',
                        'value' => 'm',
                        'checked' => TRUE,
                        'style' => 'margin:10px',
                        );
                        $female = array(
                        'name' => 'gender',
                        'id' => 'rad_female',
                        'value' => 'f',
                        'checked' => FALSE,
                        'style' => 'margin:10px',
                        );

                        echo 'Masculin' . form_radio($male);
                        echo 'Féminin' . form_radio($female, 'Female');
                    ?>
                </td>
            </tr>
            <tr>
                <td >
                    <label for="phone">Téléphone<font color="red">*</font></label>
                </td>
                <td><input type="text" size="35" name="phone" id="phone" value="<?php echo set_value('phone'); ?>"/></td>
            </tr>
           
            <tr>
                <td >
                    <label for="address">Addresse <font color="red">*</font></label>
                </td>
                <td><input type="text" size="35" name="address" id="address" value="<?php echo set_value('address'); ?>"/></td>
            </tr>
           
            <tr>
                <td>
                    <label for="city">Ville:</label>
                </td>
                <td><?php echo form_dropdown('city',dropdown_data($selected_region_setting),01,'style="width:150px;"')?></td>
            </tr>
            <tr valign="top">
                <td ><label ><?php echo $captcha_img;?></label></td>
                <td><input type="text" name="captcha" size="20" style="margin-top: 20px;"/></td>
            </tr>
          
            <tr>
              <td></td><td><input type="submit" name="submit" id="submit" value="Enregistrer"/></td>
            </tr>
        </table>

    <?php echo form_close() ?>
    </form>
</div>